1. Field of the Invention
The present invention relates to the protection of a computer system and, more particularly, to protection of data and applications stored in the memory of the computer system from losses due to interruption of power occurring during a sleep state.
2. Description of the Related Art
Power outages, or blackout periods, are occasionally encountered in large cities as well as in rural areas. Also common are brownout periods, in which the available electrical power is reduced, though not completely shut off, for a period of time. In most settings, blackout and brownout periods cause inconvenience, but nothing more. The temporary loss of, or reduction in, available power may result in loss of lighting, television and other electrical appliances for the duration of the blackout or brownout.
More problematically, some electrical devices can suffer loss of information during a blackout or brownout period. Many consumers, for example, have had to reset alarm clocks and reprogram video recorders after a blackout or brownout period. While this inconvenience may be troublesome, the loss of computer content during such a period may be catastrophic. This is because computer systems may have large amounts of data in active, volatile memory at any given time. As volatile media require continuous power to hold data, any data contained in volatile memory is lost during a power reduction, however fleeting the power loss may be. Consequently, power outages have been a major concern to the computer industry since its inception.
Portable computers are, by their very nature, typically powered by batteries rather than AC current. Because loss of battery power results in data loss, the issue of how to save active memory before power loss has been addressed with portable computers. One solution is to invoke a "hibernation" state when the computer detects a low battery condition. The hibernation routine creates a file to be stored on a non-volatile region of the computer, such as a mass storage device, terminates the user interface, stores the entire content of memory in the file, and then shuts down the computer. The hibernation mechanism therefore retains a "snapshot" of the system state until the battery is either recharged or replaced, or until another source of power, such as AC current, is provided to the portable computer system.
To support the hibernation feature, voltage level sensors within the battery of the portable computer system are monitored. When a predetermined threshold of remaining battery life is reached, the hibernation routines are initiated. Although quite useful in the battery-operated world of portable computers, the hibernation mechanism is not suitable for desktop computers. Desktop computers typically do not run on batteries, but generally rely on AC current as a power source. Thus, loss of power is less predictable than with battery-operated computers. Accordingly, the risk of losing memory content remains a considerable problem for non-portable (such as desktop) personal computers.
Another solution for avoiding catastrophic data loss is automatic periodic backup. Many software applications, for example, periodically store the current state of the application or open files to a backup region on the computer's hard drive. If a total or partial power outage occurs during the execution of such an application, a user may retrieve a copy of a reasonably recent version of the open file when power resumes. Thus, the user only loses some of the information that was recently provided to the application.
While periodic storage and backup of particular files is a sensible way to protect against power outages, doing the same for all the computer's memory is more problematic. Besides requiring a large commitment of resources (a non-volatile storage medium, hardware support, and software support, to name a few), a periodic backup of a computer's entire memory region takes more time than saving a single file. Furthermore, performing such a backup periodically, as would be necessary given the unpredictability of power loss, would be disruptive and annoying for the user. Finally, because power could completely fail before such a backup was complete, periodic automatic backup of the entire computer memory may not even succeed. Thus, such periodic backup of a computer's memory is not a particularly attractive solution.
Modern computer use is rapidly approaching the point in which many idle computers remain turned on. Leaving the computer on all the time allows many background functions to occur, such as receiving and forwarding electronic mail and facsimiles, as well as allowing "instant on" access to files when the user desires to return to the computer.
Consequently, some computer manufacturers have created a "sleep" state, in which computers may be operated at a reduced power consumption level. The "sleeping" computer can then be "awakened," or resumed, upon an event such as the receipt of electronic mail, a fax, or a user's keystroke. Reduced power consumption, even on a desktop computer, is thus useful in a number of situations when the user is not actively using the computer, but needs the computer to be available.
However, total and partial power outages can still occur when the computer is in a sleep mode. During sleep mode, output devices are generally disabled until the occurrence of an interrupting or waking event. However, anything that was loaded into memory before sleep mode remains stored in memory. As memory is volatile RAM, it requires a constant source of power; otherwise, its contents are lost. Thus, if a total or partial power outage occurs while the computer system is in a sleep mode, active memory is irretrievably lost. Because the occurrence of total and partial power outages is unpredictable and the resulting loss of information is so abrupt, there is little opportunity to detect the loss of power and create a hibernation file, as can be done in the more controlled environment of the portable computer. Desktop and other computer systems relying on AC power are therefore exposed to the risk catastrophic data loss when the computer is in a sleep state.